//
//  MemoriesViewController.m
//  Memories
//
//  Created by Brennan Stehling on 10/26/09.
//  Copyright SmallSharpTools LLC 2009. All rights reserved.
//

#import "MemoriesViewController.h"
#import "Worker.h"

@implementation MemoriesViewController

@synthesize button1;
@synthesize button2;

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
	[button1 release];
	[button2 release];
}

- (void)dealloc {
	[button1 release];
	[button2 release];
    [super dealloc];
}

- (IBAction)pressButton1 {
	NSLog(@"pressButton1");
	Worker *w = [[Worker alloc] init];
	[w setString1:@"test"];
	[w setString2:@"test"];
	NSMutableArray *array = [[NSMutableArray alloc] init];
	[array addObject:@"test1"];
	[array addObject:@"test2"];
	[array addObject:@"test3"];
	[w setArray:array];
	[array release];
	[w doAction1];
	// below is necessary to prevent a leak?
	//[[w array] release];
	[w release];
}

- (IBAction)pressButton2 {
	NSLog(@"pressButton2");
	Worker *w = [[Worker alloc] init];
	[w doAction2];
	[w release];
}

/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/

/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

@end
